/*
 * @Author: xuesong
 * @Date: 2021-12-14 22:19:42
 * @LastEditors: xuesong
 * @LastEditTime: 2022-01-11 11:21:19
 * @FilePath: \BLE-SDK-SVN499-V03\projects\ble_mulit\simpleBleMultiConnection\src\TM1640\tm1640.h
 */
#ifndef __TM1640_DRIVER_H__
#define __TM1640_DRIVER_H__

#include "types.h"

#ifdef __cplusplus
extern "C"
{
#endif
//-------------------CMD---------------------------
#define     DISPLAY_MODE_CMD    (0x00<<6)
#define     DISPLAY_DATA_CMD    (0x01<<6)
#define     DISPLAY_CONTROL_CMD (0x02<<6)
#define     DISPLAY_ADDR_CMD    (0x03<<6)
//-------------------DATA OPTION-------------------
#define     DISPLAY_DATA_ADDP   (0x00)
#define     DISPLAY_DATA_ADDS   (0x04)
#define     DISPLAY_DATA_TEST   (0x08)
//--------------------CONTROL OPTION----------------
#define     DISPLAY_CONTROL_PWM1_16  (0x00)
#define     DISPLAY_CONTROL_PWM2_16  (0x01)
#define     DISPLAY_CONTROL_PWM4_16  (0x02)
#define     DISPLAY_CONTROL_PWM10_16 (0x03)
#define     DISPLAY_CONTROL_PWM11_16  (0x04)
#define     DISPLAY_CONTROL_PWM12_16  (0x05)
#define     DISPLAY_CONTROL_PWM13_16  (0x06)
#define     DISPLAY_CONTROL_PWM14_16  (0x07)
#define     DISPLAY_CONTROL_ON        (0x08)
#define     DISPLAY_CONTROL_OFF       (0x00)
//--------------------------------------------------
#define     TM1640_DISPLAY_SIZE     16
//--------------------------------------------------
extern uint8 TM1640_DISP_BUFF[TM1640_DISPLAY_SIZE];
//--------------------------------------------------
void Tm1640_IO_Init(void);
void Tm1640_IO_PowerDown(void);
void TM1640_Init(void);
void TM_Display(uint8 *dataBuff,uint8 len);
#ifdef __cplusplus
}
#endif

#endif


